import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

export default function agencyTaskAPI(api) {
  return {
    // 获取券池名称下拉
    getTableData: (query) => api.get(`${config.interfaces.type1}flow/todo`, query),
    // 获取审批历史信息
    getHistory: (query) => api.get(`${config.interfaces.type1}flow/history`, query),
    // 通过或拒绝
    agreeOrNo: (query) => api.post(`${config.interfaces.type1}flow/approve`, query),
    // 审批信息
    approvalList: {
      // 获取券池审批通用要素和标的要素
      pool: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/flowTodo`, query),
      //获取限额审批基本信息
      queryLimitApprovalInfo: (query) => api.get(`${config.interfaces.type5}risk-server/instruction/findOneById`, query),
      //获取限额审批风险条目列表
      queryLimitApprovalList: (query) => api.post(`${config.interfaces.type5}risk-server/riskCtrl/query-warning-history`, query),
      //查询交易对手黑白名单
      getBWList: (query) => api.get(`${config.interfaces.type5}counterparty-server/counterpartyProcess/getBWList`, query),
      //修改黑白名单详情
      updateBWlist: (query) => api.post(`${config.interfaces.type5}counterparty-server/counterpartyProcess/updateBWList`, query),
    },
  };
}
